package com.util;

import java.rmi.RemoteException;

import javax.ejb.CreateException;

import com.ejbs.ESCliente;
import com.ejbs.ESClienteHome;
import com.ejbs.ESDepartamento;
import com.ejbs.ESDepartamentoHome;
import com.ejbs.ESEmpresa;
import com.ejbs.ESEmpresaHome;
import com.ejbs.ESPais;
import com.ejbs.ESPaisHome;
import com.ejbs.ESTipoCliente;
import com.ejbs.ESTipoClienteHome;
import com.ejbs.Tiger;
import com.ejbs.TigerHome;

public class Factory {
	
	static ServiceLocator instance = ServiceLocator.getInstance();
	
	
    public static Tiger getTiger() throws RemoteException, CreateException {        
        TigerHome ejbTigerHome = (TigerHome)instance.getObject(TigerHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    public static ESCliente getCliente() throws RemoteException, CreateException {        
        ESClienteHome ejbTigerHome = (ESClienteHome)instance.getObject(ESClienteHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    public static ESTipoCliente getTipoCliente() throws RemoteException, CreateException {        
        ESTipoClienteHome ejbTigerHome = (ESTipoClienteHome)instance.getObject(ESTipoClienteHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    public static ESEmpresa getEmpresa() throws RemoteException, CreateException {        
        ESEmpresaHome ejbTigerHome = (ESEmpresaHome)instance.getObject(ESEmpresaHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    public static ESDepartamento getDepartamento() throws RemoteException, CreateException {        
        ESDepartamentoHome ejbTigerHome = (ESDepartamentoHome)instance.getObject(ESDepartamentoHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    public static ESPais getPais() throws RemoteException, CreateException {        
        ESPaisHome ejbTigerHome = (ESPaisHome)instance.getObject(ESPaisHome.JNDI_NAME);
        return ejbTigerHome.create();
    }
    
    
    
}
